# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kdeconnect
pkgver=20.04.3
pkgrel=0
pkgdesc="Adds communication between KDE and your smartphone"
url="https://community.kde.org/KDEConnect"
arch="all !armhf" # armhf blocked by kirigami2 -> qt5-qtdeclarative
license="GPL-2.0-only OR GPL-3.0-only"
depends="kirigami2 sshfs"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtmultimedia-dev ki18n-dev kconfigwidgets-dev kdbusaddons-dev kiconthemes-dev knotifications-dev kio-dev kcmutils-dev kservice-dev kirigami2-dev kpeople-dev kdoctools-dev qca-dev pulseaudio-qt kpeoplevcard-dev"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
source="$pkgname-$pkgver.tar.xz::https://download.kde.org/stable/release-service/$pkgver/src/kdeconnect-kde-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-kde-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_LIBEXECDIR=lib \
		-DEXPERIMENTALAPP_ENABLED=TRUE
	cmake --build build
}

check() {
	cd build
	# testsslsocketlinereader is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(testsslsocketlinereader|testnotificationlistener)"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="148526e1c216725fa92b96682ea2a78f4bbb94d56066bc545fee875b321eda2b41f75f840366d1a69e74ea3e40832ac70dce912226427df019fed4387c68ec43  kdeconnect-20.04.3.tar.xz"
